package com.sgzn.sgpay.model.request.util;

import lombok.ToString;

import java.io.Serializable;

/**
 * 分页参数请求基类
 * @author zhongzhongyong
 * @version Id: TPageParameter.java, v 0.1 2018/4/25 23:12 zhongzhongyong Exp $$
 */
@ToString(callSuper = true)
public class PageQueryParam implements Serializable{
    private static final long serialVersionUID = -2050903899112211502L;

    public static final int DEFAULT_PAGE_SIZE = 10;

    private int pageSize;
    private int currentPage;
    private int totalPage;
    private int totalCount;

    public PageQueryParam() {
        this.currentPage = 1;
        this.pageSize = DEFAULT_PAGE_SIZE;
    }

    /**
     * 
     * @param currentPage
     * @param pageSize
     */
    public PageQueryParam(int currentPage, int pageSize) {
        this.currentPage = currentPage;
        this.pageSize = pageSize;
    }

    public int getCurrentPage() {
        return currentPage <= 0 ?1 : currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getPageSize() {
        return pageSize <= 0 ?10 : pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

}
